package com.mzj.saas.jobs.bill.repository;



import com.mzj.saas.jobs.bill.entity.HouseRemaining;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface HouseRemainingRepository extends JpaRepository<HouseRemaining,Long>,JpaSpecificationExecutor<HouseRemaining> {

    HouseRemaining findByOrgIdAndHouseIdAndStatus(Long orgId,String houseId,Integer status);

    List<HouseRemaining> findByStatus(Integer status);

    List<HouseRemaining> findByHouseId(String houseId);

    @Query(value = "SELECT * FROM saas_house_remaining  where match_user_id is null  and (status != 2 or status != 5)  ", nativeQuery=true)
    List<HouseRemaining> findByMatchUserIdIsNull();

}
